package com.itcast.gameforum.service.impl;

import com.itcast.gameforum.entity.User;
import com.itcast.gameforum.mapper.UserMapper;
import com.itcast.gameforum.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 647zyzlq
 * @since 2020-10-21
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    public void alterPassword(String username, String password) {
        userMapper.alterPassword(username,password);
    }

    @Override
    public void uploadAvatar(String username, String newavatar) {
        userMapper.uploadAvatar(username,newavatar);
    }

    @Override
    public int saveUser(User user) {
        return userMapper.saveUser(user);
    }
}
